package abstractclass;

public class Demo01 {
    public static void main(String[] args) {
        Frog f = new Frog();//Frog f=0x1B
        method01(f);

        System.out.println("-------------");

        Animal a = method02();//Animal a=new Frog();
        a.eat();//遵循多态调用原则
    }

    public static void method01(Animal a) {//Animal a=new Frog();//多态
        a.eat(); //遵循多态调用原则
    }
    public static Animal method02() {
       /* Frog frog = new Frog();//Frog frog=0x5D
        return frog;//return 0x5D*/
       return new Frog();
    }
}
